package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.PageParam;
import com.cskaoyan.bean.User;
import com.cskaoyan.bean.UserParam;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author stone
 * @date 2021/11/23 11:07
 */
@RestController
@RequestMapping("user")
public class UserController {

    //localhost:8080/user/register?username=songge&age=30&married=true
    //&hobbies=sing&hobbies=dance&birthday=1991/11/23
    @RequestMapping("register")
    public BaseRespVo register(String username, Integer age, boolean married, String[] hobbies, Date birthday) {
        return BaseRespVo.ok(null);
    }

    //localhost:8080/user/register2?username=songge&age=30&married=true
    //&hobbies=sing&hobbies=dance&birthday=1991/11/23
    @RequestMapping("register2")
    public BaseRespVo register2(User user) {
        return BaseRespVo.ok(null);
    }

    //localhost:8080/user/list?username=songge&age=30&page=1&limit=10
    @RequestMapping("list")
    public BaseRespVo list(String username, Integer age, Integer page, Integer limit) {
        return BaseRespVo.ok(null);
    }

    //localhost:8080/user/list2?username=songge&age=30&page=1&limit=10
    @RequestMapping("list2")
    public BaseRespVo list2(String username, Integer age, PageParam pageParam) {
        return BaseRespVo.ok(null);
    }

    //localhost:8080/user/list3?username=songge&age=30&page=1&limit=10
    @RequestMapping("list3")
    public BaseRespVo list3(UserParam userParam) {

        return BaseRespVo.ok(null);
    }

}
